

# 方法一
# def h_num(n):
#     s = str(n)
#     j = 0
#     for i in range(len(s)//2):
#         if s[i] == s[-i-1]:
#             j = j + 1
#     return j == len(s) // 2


# 方法二

def h_num(n):

    s = str(n)
    return s[:] == s[:: -1]


s = list(filter(h_num, range(1001)))
print(s)

